<?php

Class Application_Form_Contact extends Zend_Form
{
	public function init()
	{
		$this->setName('Contact');
			
		$this->addElement('text','name', array(
			'label' => "Votre nom :",
			'filters' => array('htmlentities'),
			'addFilter' =>('StripTags'), // pas de balise
			'addValidator' => ('NotEmpty'), // pas vide 
			'required' => true,
		));

		$this->addElement('text','email', array(
			'label' => "Votre mail :",
			'filters' => array('htmlentities'),
			'addFilter' =>('StripTags'),
			'addValidator' => ('NotEmpty'),  
			'required' => true,
		));

		$this->addElement('text','sujet', array(
			'label' => "Sujet :",
			'filters' => array('htmlentities'),
			'addFilter' =>('StripTags'),
			'addValidator' => ('NotEmpty'),
			'required' => true,
		));

		$this->addElement('textarea','message', array(
			'label' => "Votre message :",
			'filters' => array('htmlentities'),
			'addFilter' =>('StripTags'),
			'addValidator' => ('NotEmpty'), 
			'rows'=>10,
			'cols'=>70,
		));
		
		$publickey ='6LfvwMoSAAAAAD7HmdLB_r2x9KR_WPP01RlYQrS0' ;
		$privatekey = '6LfvwMoSAAAAAAQNw8Toz0nD8MCdFxlvzSbJd_Qv' ;
		$recaptcha = new Zend_Service_ReCaptcha($publickey, $privatekey);
		
		$captcha = new Zend_Form_Element_Captcha('challenge',array(
			'captcha' => 'ReCaptcha',
			'captchaOptions' => array(
			'captcha' => 'ReCaptcha',
			'service' => $recaptcha)));

		$this->addElement($captcha);
			
		$this->addElement('submit','envoyer', array(
			'label' => "Envoyer",		
		));	
	}
}
